#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long LL;
const int N = 2e6 + 10;

void solve()
{
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    s = ' ' + s;
    set<int> st;
    for (int i = 1; i <= m; i++)
    {
        int x;
        cin >> x;
        st.insert(x);
    }
    vector<int> pos;
    pos.push_back(1);
    for (int i = 1; i <= n; i++)
    {
        if (pos.back() != 1)
            pos.pop_back();
        int newpos = pos.back();
        if (i >= 2)
        {
            newpos++;
            if (s[i - 1] == 'B')
            {
                while (st.find(newpos) != st.end())
                    newpos++;
            }
            pos.push_back(newpos);
        }
        newpos++;
        if (s[i] == 'B')
        {
            while (st.find(newpos) != st.end())
                newpos++;
        }
        pos.push_back(newpos);
        st.insert(newpos);
    }
    cout << st.size() << endl;
    for (auto x : st)
    {
        cout << x << ' ';
    }
    cout << endl;
}
    signed main()
    {
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        int t = 1;
        cin >> t;
        while (t--)
        {
            solve();
        }
    }